<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>千禧宝贝连锁店管理信息系统</title>
<%@ include file="../../common/Style.jsp"%>

<script>
$(document).ready(function(){
	parent.$.messager.progress('close'); 
});


function post(){
	 $.messager.confirm('单据过账提示', '确认单据过账吗?', function(r){
         if (r){
        	 if ( $('#financeBillCorpFlowForm').form('validate')){
        		    var params=$("#financeBillCorpFlowForm").serialize();
        	    	$.post("financeHQJSON!postFbillCorpFlow",params, updateBKProcess,"json");	
        		}
         }
     });
	
}

function saveDraft(){
	 $.messager.confirm('单据保存草稿提示', '确认单据保存为草稿吗?', function(r){
         if (r){
        	 if ( $('#financeBillCorpFlowForm').form('validate')){
        		    var params=$("#financeBillCorpFlowForm").serialize();
        	    	$.post("financeHQJSON!saveDraftFbillCorpFlow",params, updateBKProcess,"json");	
        		}
         }
     });
	
}

function updateBKProcess(data){
	var returnCode = data.returnCode;
	if (data.success){
		$.messager.alert({
			title: '保存成功',
			msg: data.message,
			fn: function(){
				window.location.href = "financeHQJSP!editFinanceBillCorpFlow";
			}
		});
		
	}    
	else {
		 $.messager.alert('提示', data.message, 'warning');
	}		
    
}

function cancel(){
	$.modalDialog.handler.dialog('close');
}


</script>
</head>
<body>
   <s:form action="" method="POST"  name="financeBillCorpFlowForm" id="financeBillCorpFlowForm" theme="simple"> 
	<table width="95%" align="center"  class="OuterTable">
	    <tr><td>
	     <s:hidden name="formBean.financeBillCorpFlow.id"></s:hidden>
		 <table width="100%" border="0">
		    <tr class="PBAOuterTableTitale">
		       <td height="50" colspan="3">机构转账: <s:property value="formBean.financeBillCorpFlow.statusS"/></td>
	        </tr>

	        	<tr class="InnerTableContent">
				<td>单据号 :</td>
				<td><s:property value="formBean.financeBillCorpFlow.id"/></td>
				<td>&nbsp;</td>
			</tr>
	        
	        <tr class="InnerTableContent">
				<td>单据号日期:</td>
				<td><s:textfield name="formBean.financeBillCorpFlow.date" id="fromAcctId"
						cssClass="easyui-datebox" style="width:150px;"/></td>
						<td>&nbsp;</td>
			</tr>	 
			<tr class="InnerTableContent">
				<td>转入机构(账目) :</td>
				<td><s:select name="formBean.financeBillCorpFlow.toAcctId.id" id="toAcctId"
						cssClass="easyui-combobox" style="width:150px;"
						list="uiBean.financeCategory" listKey="id" listValue="itemName" /></td>
						<td>&nbsp;</td>
			</tr>       
		    <tr class="InnerTableContent">
				<td>转出机构(账目) :</td>
				<td><s:select name="formBean.financeBillCorpFlow.fromAcctId.id" id="fromAcctId"
						cssClass="easyui-combobox" style="width:150px;"
						list="uiBean.financeCategory" listKey="id" listValue="itemName" /></td>
						<td>&nbsp;</td>
			</tr>

			<tr class="InnerTableContent">
				<td>转账金额 :</td>
				<td><s:textfield id="initialAmt" name="formBean.financeBillCorpFlow.amount"
						cssClass="easyui-numberbox" data-options="prompt:'请输入转账金额',precision:2,min:0,max:10000000" /></td>
						<td>&nbsp;</td>
			</tr>
			<tr class="InnerTableContent">
				<td>备注信息:</td>
				<td><s:textfield id="comment" name="formBean.financeBillCorpFlow.comment"
						cssClass="easyui-textbox" data-options="prompt:'请输入备注信息'"  style="width:50%;height:40px;"/></td>
						<td>&nbsp;</td>
			</tr>
						
			<tr class="InnerTableContent">
				<td></td>			
				<td><a onclick="saveDraft();"
					href="javascript:void(0);" data-options="iconCls:'icon-save'" class="easyui-linkbutton">保存草稿</a> 
					<a onclick="post();"
					href="javascript:void(0);" data-options="iconCls:'icon-save'" class="easyui-linkbutton">单据过账</a> </td>
				
			</tr>	        
		    <tr class="InnerTableContent">
		      <td width="12%" height="30">
		      </td>
		      <td width="79%">
		        &nbsp;
		      </td>
		      <td>&nbsp;</td>
		    </tr>
		  </table>
	   </td></tr>
	 </table>
	 </s:form>
   
</body>
</html>